import { Module } from "vuex";
import { RootProps } from "../index";

interface activityprops{
    id:number
    name:string
    courses:any
      coursestype:string
      Denomination:number
      num:number
}
export interface activityArrayProps {
    tableData: activityprops[]
}
const activityState: Module<activityArrayProps, RootProps> = {
    actions: {
        setDataList({commit}, data){
            commit("setDataList", data)
        }
    },
    mutations: {
        setUserList(state, data){
            state.tableData = data;
        },
        addactivity(state,data){
            state.tableData.push(data)
        },
    },
state:{
    tableData:[{
        id:1,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"课程券",
        Denomination:90,
        num:100
    },{
        id:2,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"课程券",
        Denomination:10,
        num:100
    },{
        id:3,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"课程券",
        Denomination:70,
        num:100
    },{
        id:4,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"课程券",
        Denomination:20,
        num:100
    },{
        id:5,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"商品券",
        Denomination:40,
        num:100
    },{
        id:6,
        name:"课程券",
        courses:["减肥","游泳"],
        coursestype:"商品券",
        Denomination:30,
        num:100
    },]
},
getters: {
    allDateList(state){
        return state.tableData
    }
}
}
export default activityState